﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using EbbinghausWord.BLL;
using Microsoft.Phone.Tasks;

namespace EbbinghausWord.Controls
{
    public partial class HintControl : UserControl
    {
        public HintControl()
        {
            InitializeComponent();

        }

        private void goTile_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var task = new MarketplaceDetailTask
                {
                    ContentIdentifier = "a276080f-af9d-474f-81ea-0753baead6dd",
                    ContentType = MarketplaceContentType.Applications
                };

                task.Show();
                this.Visibility = Visibility.Collapsed;
                new UserConfig().IsFirstOpen = false;
            }
            catch (Exception)
            {
            }

        }

        private void noTile_Click(object sender, RoutedEventArgs e)
        {
            this.Visibility = Visibility.Collapsed;
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                this.Visibility = new UserConfig().IsFirstOpen ? Visibility.Visible : Visibility.Collapsed;
            }
            catch (Exception)
            {
            }
        }
    }
}
